Skip to content

feat: pin downloaded binaries with sha256 verification#362

Open
art049 wants to merge 2 commits into
mainfrom
feat/pin-binary-downloads-sha256
Open

feat: pin downloaded binaries with sha256 verification#362
art049 wants to merge 2 commits into
mainfrom
feat/pin-binary-downloads-sha256

Conversation

@art049
Copy link
Copy Markdown
Member

@art049 art049 commented May 21, 2026

Every binary the runner downloads at install time (the patched valgrind .deb, the memtrack installer, the exec-harness installer, the mongo-tracer installer) is now SHA-256-pinned. URLs and expected hashes live together in a new PinnedBinary enum in src/binary_pins.rs, and the download helper (download_pinned_file) rejects the install — and removes the partial file — if the bytes don't match the declared digest.

Until now, the runner trusted whatever it pulled from GitHub releases / S3 to be the artifact that was published. That trust is implicit and we have no recovery if an artifact is replaced. Pinning the hashes alongside the version constants makes the supply-chain assumption explicit and verifiable at install time.

Bumping a pinned version now requires updating both the version constant and the matching PinnedBinary::sha256 arm — for valgrind, one hash per supported (distro_version, arch) combination. CONTRIBUTING.md is updated with the regeneration workflow and the release checklist points at the new location.

Every binary the runner downloads at install time (the patched valgrind
.deb, the memtrack/exec-harness/mongo-tracer installer scripts) is now
SHA-256-pinned. URLs and expected hashes live together in a new
`PinnedBinary` enum, and the download helper rejects the install if the
bytes don't match.

Bumping a pinned version requires updating both the version constant and
the matching hash; CONTRIBUTING.md documents the regeneration workflow.

Co-Authored-By: Claude <noreply@anthropic.com>
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 21, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 7 untouched benchmarks


Comparing feat/pin-binary-downloads-sha256 (585b6dd) with main (4eac647)

Open in CodSpeed

Add a network-bound test that downloads each `PinnedBinary` variant
(valgrind for every supported distro/arch combination, plus the three
installer scripts) and asserts the bytes match the declared SHA-256 via
`download_pinned_file`. Gated behind `GITHUB_ACTIONS` like the other
network/sudo tests, so it runs in CI but is opt-in locally.

This catches a stale or mistyped hash before the release rather than at
install time on a user's machine. Document the local invocation in
CONTRIBUTING.md alongside the regeneration workflow.

Co-Authored-By: Claude <noreply@anthropic.com>
@art049 art049 requested a review from GuillaumeLagrange May 21, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant